<?php
namespace app\admin\model;
use think\Model;
use think\Session;

class Custom extends Model{

   public function getList(){
        return $this->select();
   }

   //分页数据
   public function getPage(){
       //当前登录用户的id
       $id=Session::get('trade_user_id');
       if($id==1){
           return $this::paginate();
       }else{
           $childId=array();
           $childId[]=$id;
           $childId[]= db('user')->where('id',$id)->value('pid');

           $res=$this::where(['id'=>['in',$childId]])->paginate(50);
           return $res;
       }
   }

}